<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>抽奖页面</title>
<style>
    #showJP {
        margin-top: 20px;
        font-size: 20px;
        font-weight: bold;
    }
    body{
        text-align: center;
    }
</style>
</head>
<body>

<div id="showJP">点击抽奖按钮获取奖品</div>
<button onclick="chouJiang()">开始抽奖</button>

<script>
    let jiangpin = ["华为Mate70pro", "华为PadPro", "小米14Ultra", "suu模型", "荣耀60i"];

    function chouJiang() {
        // 生成一个 0 至 jiangpin.length-1 的随机整数
        let randomIndex = Math.floor(Math.random() * jiangpin.length);
        
        // 从数组中随机抽选一个奖品
        let winningPrize = jiangpin[randomIndex];
        
        // 显示在页面 div#showJP 里
        document.getElementById('showJP').innerText = `天呐！恭喜您获得奖品：${winningPrize}`;
    }
</script>

</body>
</html>